#include <stdio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>

#define BUFFER_SIZE 100
#define BUFFER_SIZE2 11



int main()
{

/*生成随机数的种子*/

   int array[BUFFER_SIZE];
   int random = rand();
   for(int idx = 0; idx < BUFFER_SIZE; idx++)
   {
         /*生成随机数的种子*/
         srand((unsigned int)time(NULL));
         array[idx] = rand() % 10 + 1;
      

   }
   int array2[BUFFER_SIZE2];
   memset(array2, 0, sizeof(array2));//清楚脏数据

   for(int idx = 0; idx < BUFFER_SIZE; idx++)
   {

      switch(array[idx])
      {

         case 1:
            array2[1]++;
            break;
         case 2:
            array2[2]++;
            break;
         case 3:
               array2[3]++;
               break;
         case 4:
               array2[4]++;
               break;
         case 5:
            array2[5]++;
            break;
         case 6:
            array2[6]++;
            break;
         case 7:
               array2[7]++;
               break;
         case 8:
               array2[8]++;
               break;
         case 9:
               array2[9]++;
               break;
         case 10:
               array2[10]++;
               break; 
         default:
            break; 
      }

   }
   int max_num = array2[1];
   int sub = 1;
   for(int idx = 2; idx < BUFFER_SIZE2; idx++)

   {
         if(array2[idx] > max_num)
         {

            max_num = array2[idx];
            sub = idx;

         }


   }
   printf("%d\n", sub);
   printf("%d\n",max_num);
   return 0;

   /* 作业：100个数的范围在1-10，哪个数出现的次数最多*/


}